import { hasPerm } from '@/utils/util';
const isAuth = (el, binding: any) => {
    const value = binding.value;
    if (!value) {return}
    const res = hasPerm(value);
    if (!res) {
        el.parentNode?.removeChild(el);
    }
};

const mounted = (el, binding: any) => {
    isAuth(el, binding);
};

const vAuth = {
    mounted
};
export const setupAuthDirective = (app: any) => {
    app.directive('auth', vAuth);
};
